//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <fstream>

#include "DisProtAnalysis.h"
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
using namespace std;
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
int main(int argc, char** argv) {

  String* filenameResults;
  String* filenameOut;
  int     range;

  if (argc < 4) {
    cout << "Error in the input arguments. The execution must be: " << endl;
    cout << "./DisProtAnalysis <Input File> <Output Name> <Range of Percent to Analyze>" << endl;
    return 0;
  }
  else {
    cout << "---------------------------------------------------------------------------------" << endl;
    cout << "  Input File : " << argv[1] << endl;
    cout << " Output Name : " << argv[2] << endl;
    cout << "       Range : " << argv[3] << endl;
    cout << "---------------------------------------------------------------------------------" << endl;
    filenameResults = new String(argv[1]);
    filenameOut     = new String(argv[2]);
    range           = atoi(argv[3]);
  }

  DisProtAnalysis* disProtAnalysis = new DisProtAnalysis();

  disProtAnalysis->Filename(filenameResults);
  disProtAnalysis->ReadIDPFile();
  
  disProtAnalysis->NumberSequencePerIDPsPercernt(filenameOut, range);

  if (filenameResults) delete filenameResults;
  if (filenameOut)     delete filenameOut;

  if (disProtAnalysis) delete disProtAnalysis;

  return 1;

}
//---------------------------------------------------------------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------------------------------------------------------------//


